package com.haiyou.common.exception;


import com.haiyou.common.constant.MsgCode;

/**
 * 业务异常类
 *
 * @author root
 * @date 2018/11/22 16:13
 */
public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private MsgCode msgCode;

    public BusinessException() {
        this.msgCode = MsgCode.SERVER_EXCEPTION;
    }

    public BusinessException(MsgCode msgCode) {
        super(msgCode.getMessage());
        this.msgCode = msgCode;
    }
    public BusinessException(MsgCode msgCode, String message) {
        super(message);
        this.msgCode = msgCode;
    }

    public MsgCode getMsgCode() {
        return msgCode;
    }
}
